/**
 *  *2010-6-7 下午03:06:12  add 
 */
package com.base.myproject.client.ui.celleditor;

import com.extjs.gxt.ui.client.binding.FieldBinding;
import com.google.gwt.core.client.GWT;

/**
 * @author Administrator
 *2010-6-7
 * javazgw@gmail.com
 */
public class BaseComboxXBinding extends FieldBinding{
	protected BaseComboBoxX simpleComboBox;
	 public BaseComboxXBinding(BaseComboBoxX field, String property) {
		    super(field, property);
		    this.simpleComboBox = field;
		  }
	 
	 
	  @Override
	  protected Object onConvertFieldValue(Object value) {
	    return simpleComboBox.getValue();
	  }

	  @SuppressWarnings("unchecked")
	@Override
	  protected Object onConvertModelValue(Object value) {
	    return simpleComboBox.findModel(value);
	  }
	  
	  public void updateField() {
		 
	    Object val = onConvertModelValue(model.get(property));
	    
	    field.setValue(val);
	  }
}
